package co.fitstart.mobile.entity.appointment;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;

import com.demo2do.core.utils.DateFormatUtils;

/**
 * 
 * @author mohanlan
 *
 */
public class Appointment {
    
    private Long roundId;
    
    private Long siteId;
    
    private Long coachId;
    
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date day;
    
    private String hour;
    
    private String areaType;
    
    /**
     * The default constructor
     */
    public Appointment() {
    }
    
    /**
     * 
     * @return
     */
    public boolean isValid() {
        return this.roundId != null && this.siteId != null && this.day != null &&
                StringUtils.isNotBlank(this.hour) && StringUtils.isNotBlank(hour);
    }

    public String getDayString() {
        return this.day == null ? null : DateFormatUtils.format(this.day);
    }

    /**
     * @return the roundId
     */
    public Long getRoundId() {
        return roundId;
    }

    /**
     * @return the siteId
     */
    public Long getSiteId() {
        return siteId;
    }

    /**
     * @return the coachId
     */
    public Long getCoachId() {
        return coachId;
    }

    /**
     * @return the day
     */
    public Date getDay() {
        return day;
    }

    /**
     * @return the hour
     */
    public String getHour() {
        return hour;
    }

    /**
     * @return the areaType
     */
    public String getAreaType() {
        return areaType;
    }

    /**
     * @param roundId the roundId to set
     */
    public void setRoundId(Long roundId) {
        this.roundId = roundId;
    }

    /**
     * @param siteId the siteId to set
     */
    public void setSiteId(Long siteId) {
        this.siteId = siteId;
    }

    /**
     * @param coachId the coachId to set
     */
    public void setCoachId(Long coachId) {
        this.coachId = coachId;
    }

    /**
     * @param day the day to set
     */
    public void setDay(Date day) {
        this.day = day;
    }

    /**
     * @param hour the hour to set
     */
    public void setHour(String hour) {
        this.hour = hour;
    }

    /**
     * @param areaType the areaType to set
     */
    public void setAreaType(String areaType) {
        this.areaType = areaType;
    }
}
